package Controller.transactional;

import Models.dao.TransactionalDao;
import Models.enity.Transactional;
import Models.enity.AdminUser;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/transactional/eventHandle")
public class EventHandle extends HttpServlet {
    private static String PublicPath = "/WEB-INF/views";
    private TransactionalDao transactionalDao = new TransactionalDao();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        List<Transactional> readyToHandleData = transactionalDao.findCombineDataByStatus("1");
        List<Transactional> successHandleData = transactionalDao.findCombineDataByStatus("2");
        List<Transactional> successHandleData2 = transactionalDao.findCombineDataByStatus("4");
        List<Transactional> overHandleData = transactionalDao.findCombineDataByStatus("3");
        req.setAttribute("readyToHandleData",readyToHandleData);
        req.setAttribute("successHandleData",successHandleData);
        req.setAttribute("successHandleData2",successHandleData2);
        req.setAttribute("overHandleData",overHandleData);
        req.getRequestDispatcher(PublicPath + "/transactional/EventHandle.jsp").forward(req,resp);
    }
}
